# Contributor: Nicolas Lorin <androw95220@gmail.com>
# Maintainer: Bradley Saulteaux <bradsoto@gmail.com>
pkgname=bees
pkgver=0.7
pkgrel=0
pkgdesc="Best-Effort Extent-Same, a btrfs dedup agent"
url="https://github.com/Zygo/bees"
arch="all"
license="GPL-3.0-or-later"
depends="btrfs-progs"
makedepends="btrfs-progs-dev util-linux-dev"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Zygo/bees/archive/v$pkgver.tar.gz
	10-pthread_getname1.patch
	ppc64le_fix_min_compare.patch
	bees.initd
	"

[ "$CARCH" = "riscv64" ] && options="$options textrels"

build() {
	make all
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	mv bin "$pkgdir"/
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
}

sha512sums="
beee7563ae0ea43247465941ef15f7bab2d86d5d164ccb280c378678b0bf61a67a4718881b94a5f3a72d4d0296eda92bfd7464dae0faeaa72b0e2a4ebef39a53  bees-0.7.tar.gz
877a90b0be60357ba4778f30a89003270b93af8cc5995e2df3fb58147733a39e972129f693ce9239e8987c589f3c43384774c3baecd042e88abdb2b07d1ce2ef  10-pthread_getname1.patch
2e13a670184d71b64e04450adb182d0a6e842e1a7d561882e0a07ae4ea7a9ed15a3fcce03f61c5412eabdb2fadf559f221e21ffd10440c4b8b700f3eab02aab4  ppc64le_fix_min_compare.patch
093bc4c9604a0b28b39069e447d83800c91d0974fe4618ce5e5063e5c816b2d63c1b633710c592d76e8f6367d696283d6fa4a3a9561b09ce62fa28cabf8e55d0  bees.initd
"
